package com.onlyxiahui.framework.action.dispatcher.util;

import java.lang.reflect.Modifier;

/**
 * Date 2019-03-10 10:58:14<br>
 * Description
 * 
 * @author XiaHui<br>
 * @since 1.0.0
 */

public class ClassUtil {
	/**
	 * 
	 * 
	 * Date 2019-03-10 10:58:43<br>
	 * Description 是否可被实例化
	 * 
	 * @param classType
	 * @return
	 * @since 1.0.0
	 */
	public static boolean isCanInstance(Class<?> classType) {
		boolean can = true;
		boolean isAbstract = Modifier.isAbstract(classType.getModifiers());
		if (classType.isAnnotation()) {
			can = false;
		} else if (classType.isArray()) {
			can = false;
		} else if (classType.isEnum()) {
			can = false;
		} else if (classType.isInterface()) {
			can = false;
		} else if (isAbstract) {
			can = false;
		}
		return can;
	}
}
